# Caddy front for {{ cookiecutter.project_name }} in production.
#
# Caddy provisions TLS automatically for the DOMAIN env var (defaults to
# localhost, which uses a self-signed local CA). Static and media files are
# served straight from /data — share the /data volume with the django
# container (STATIC_ROOT=/data/static, MEDIA_ROOT=/data/media).

{$DOMAIN:localhost} {
	encode gzip

	handle /static/* {
		root * /data
		file_server
	}

	handle /media/* {
		root * /data
		file_server
	}

	reverse_proxy django:8000
}
